package com.example.minato.minastore.utils;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;

import com.example.minato.minastore.R;


public class CircleProgressDialog extends AlertDialog {

    private static CircleProgressDialog progressDialog;


    public CircleProgressDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.toast_circle_net);
        getContext().setTheme(R.style.dialog);
        setCanceledOnTouchOutside(true);
        getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        getWindow().setDimAmount(0.1f);

    }


    public static void showDialog(Context context){
        if (progressDialog == null){
            progressDialog = new CircleProgressDialog(context);
        }
        progressDialog.show();
    }

    public static void closeDialog(){
        if (progressDialog != null){
            progressDialog.dismiss();
        }
    }


}
